Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A special target for testing local nuget builds #14446

Merged
merged 3 commits into from
Mar 1, 2024
Merged

Conversation

kekekeks
Copy link
Member

@kekekeks kekekeks commented Feb 1, 2024

It is sometimes needed to quickly test local changes against an app that consumes nuget packages.

This PR allows to quickly update 9999.0.0-localbuild version in nuget cache from the current source.

(incremental build)

═══════════════════════════════════════════════════════
Target                             Status      Duration
───────────────────────────────────────────────────────
GenerateCppHeaders                 Skipped                // SkipReason: skipping CompileNative
Clean                              Skipped                // SkipReason: via --skip parameter
CompileNative                      Skipped                // SkipReason: EnvironmentInfo.IsOsx
CompileHtmlPreviewer               Skipped                // SkipReason: via --skip parameter
Compile                            Skipped                // SkipReason: via --skip parameter
CreateIntermediateNugetPackages    Succeeded       0:31
CreateNugetPackages                Succeeded       0:09
BuildToNuGetCache                  Succeeded     < 1sec
───────────────────────────────────────────────────────
Total                                              0:41
═══════════════════════════════════════════════════════

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.1.999-cibuild0044309-beta. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.1.999-cibuild0044733-beta. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.1.999-cibuild0045477-beta. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@maxkatz6 maxkatz6 marked this pull request as ready for review March 1, 2024 05:08
@maxkatz6 maxkatz6 enabled auto-merge March 1, 2024 05:08
@maxkatz6 maxkatz6 added this pull request to the merge queue Mar 1, 2024
Merged via the queue into master with commit 84515cd Mar 1, 2024
7 checks passed
@maxkatz6 maxkatz6 deleted the feature/local-cache branch March 1, 2024 06:23
@llfab
Copy link

llfab commented Mar 1, 2024

@kekekeks:

  • does this allow to locally debug into Avalonia code?
  • how would I run this locally to have the version in the local nuget cache?
  • The app itself - I guess - I would then target to 9999.0.0-localbuild, right?

@maxkatz6
Copy link
Member

maxkatz6 commented Mar 1, 2024

@llfab

You need to run nuke BuildToNuGetCache in the repository root to get these packages.
After that - just include Avalonia as you usually do from nuget, but with 9999.0.0-localbuild version.

The main point of this feature is to be able to quickly debug local Avalonia code changes, without waiting for Nightly NuGet builds. Debugging experience shouldn't be really different from typical NuGet (though, not sure how SourceLink symbols would work here).

@maxkatz6
Copy link
Member

maxkatz6 commented Mar 1, 2024

Updated build instructions to include this command https://github.com/AvaloniaUI/Avalonia/blob/master/Documentation/build.md

@llfab
Copy link

llfab commented Mar 2, 2024

Indeed I am looking for an Option to debug into Avalonia code and set breakpoints there. Seems this would not be possible with this option right?

I also thought about .props magic to easily switch between nuget packs and Avalonia repo csproj. That would be easy but then the Avalonia csproj would need to be "injected" into the solution. Not sure if that can be done.

So: would the above local packs option allow for setting breakpoints into Av code?

@kekekeks
Copy link
Member Author

kekekeks commented Mar 2, 2024

You can debug your app directly from Avalonia solution that way.

  1. open avalonia desktop slnf
  2. build to nuget cache
  3. add your executable like this:
    image
  4. remove "build solution":
    image
  5. run

Breakpoints should work.

@llfab
Copy link

llfab commented Mar 5, 2024

I came up with this here which works nicely for me:
#14819

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants